local joy__qice = fk.CreateSkill {

  name = "joy__qice",

  tags = {  },

}



joy__qice:addEffect("viewas", {
  name = "joy__qice",
  prompt = "#joy__qice",
  interaction = function(self,player)
    local names = {}
    for _, id in ipairs(Fk:getAllCardIds()) do
      local card = Fk:getCardById(id)
      if card:isCommonTrick() and not card.is_derived and card.skill:canUse(player, card) then
        table.insertIfNeed(names, card.name)
      end
    end
    return UI.ComboBox {choices = names}
  end,
  card_filter = function(self, player, to_select, selected)
    return Fk:currentRoom():getCardArea(to_select) == Player.Hand
  end,
  view_as = function(self, player,cards)
    if #cards == 0 or not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(cards)
    card.skillName = joy__qice.name
    return card
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(joy__qice.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
  end,
})

return joy__qice